package com.lhy.mymall.exception;

public enum ExceptionEnum {
    //异常枚举
    //用户模块的枚举
    NEED_USER_NAME(10001,"用户名不能为空"),
    NEED_PASSWORD(10002,"密码不能为空"),
    PASSWORD_TOO_SHORT(10003,"密码不能太短"),
    USERNAME_EXISTED(10004,"用户名已被注册"),
    INSERT_FAILED(10005,"插入失败，请重试"),
    WRONG_PASSWORD(10006,"密码错误，请重试"),
    NEED_LOGIN(10007,"未登录"),
    UPDATE_FAILED(10008,"更新失败"),
    NEED_ADMIN(10009,"你无管理员权限"),

    //商品目录模块的枚举
    NAME_NOT_NULL(10010,"商品参数字段不能为空"),
    NAME_EXISTED(10011,"商品名已存在"),
    DELETE_FAILED(10012,"删除失败"),

    //商品模块的枚举
    MKDIR_FAILED(10013,"创建目录失败"),
    UPLOAD_FAILED(10014,"上传失败"),



    //购物车模块的枚举
    NOT_SALE(10015,"商品状态异常"),
    NOT_ENOUGH(10016,"商品库存不足"),

    //订单模块的枚举
    CART_EMPTY(10017,"购物车已勾选的商品为空"),
    NO_ORDER(10018,"订单不存在"),
    NOT_YOUR_ORDER(10019,"订单不属于你的"),
    NOT_ENUM(10020,"未找到订单状态对应的枚举类"),
    CAN_NOT_CANCEL(10022,"订单已付款，不可取消"),
    NOT_PAY_STATUS(10023,"非未支付订单状态，不可付款"),
    PAYED_STATUS(10024,"非已支付状态，不可发货"),
    NOT_DELIVERED_STATUS(10025,"非发货状态，不可完结订单"),

    //进阶枚举
    WRONG_EMAIL(10026,"非法的邮件地址"),
    EMAIL_ALREADY_BEEN_REGISTERED(10027,"邮箱被已注册"),
    EMAIL_ALREADY_BEEN_SEND(10028,"验证码已发送，若无法收到，请稍后再试"),
    NEED_EMAIL_ADDRESS(10029,"邮箱地址不能为空"),
    NEED_VERIFICATION_CODE(10030,"验证码不能为空"),
    WRONG_VERIFICATION_CODE(10031,"验证码错误"),
    TOKEN_EXPIRED(10032,"token已过期"),
    TOKEN_WRONG(10033,"token解析失败"),



    SYSTEM_ERROR(20000,"系统异常");
    /**
     * 异常码
     * 异常信息
     */
    private Integer status;
    private String msg;

    /*生成构造方法*/
    ExceptionEnum(Integer status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    //生成get、set方法
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
